package com.flca.frw.events
{
	import mx.controls.Menu;
	import mx.rpc.events.AbstractEvent;
	
	public class MenuItem
	{
		public var label:String;
		public var action:String; 
		public var roles:String;
		public var type:String;
		public var enabled:String;
		public var actionId:String;//deprecated use arg1
		public var arg1:String;
		public var arg2:String;
		public var arg3:String;
		public var arg4:String;

		public var result:XML;
		
		public function MenuItem() {
			label = "";
			action = ""; 
			roles = "";
			type = "";
			enabled = "";
			actionId = "";//deprecated
			arg1 = "";
			arg2 = "";
			arg3 = "";
			arg4 = "";
		}
		
		public static function makeFromXML(aXml:XML) : MenuItem {
			var r:MenuItem = new MenuItem();

			r.label = aXml.@label;
			r.action = aXml.@action;
			r.roles = aXml.@roles;
			r.type = aXml.@type;
			r.enabled = aXml.@enabled;
			r.actionId = aXml.@actionId;
			r.arg1 = aXml.@arg1;
			r.arg2 = aXml.@arg2;
			r.arg3 = aXml.@arg3;
			r.arg4 = aXml.@arg4;

			return r;
		}

		public static function makeFromObject(aObject:Object) : MenuItem {
			var r:MenuItem = new MenuItem();

			r.label = aObject.label;
			r.action = aObject.action;
//			r.roles = aXml.@roles;
//			r.type = aXml.@type;
//			r.enabled = aXml.@enabled;
//			r.actionId = aXml.@actionId;
			
			return r;
		}
	}
}